# 工厂方法模式
from abc import ABCMeta, abstractmethod

class Shape(metaclass=ABCMeta):
    @abstractmethod
    def draw(self):
        pass

class Circle(Shape):
    def draw(self):
        print("Drawing Circle")

class Rectangle(Shape):
    def draw(self):
        print("Drawing Rectangle")

class ShapeFactory:
    @staticmethod
    def get_shape(shape_type):
        if shape_type == "circle":
            return Circle()
        elif shape_type == "rectangle":
            return Rectangle()
        else:
            return None

if __name__ == "__main__":
    circle = ShapeFactory.get_shape("circle")
    circle.draw()

    rectangle = ShapeFactory.get_shape("rectangle")
    rectangle.draw()

    shape = ShapeFactory.get_shape("unknown")
    if shape is None:
        print("Invalid shape type")
    else:
        shape.draw()